package easy;

public class Solution_961 {
    public int repeatedNTimes(int[] nums) {
        boolean[] ints = new boolean[10000];
        for (int i = 0; i < nums.length; i++) {
            if (!ints[nums[i]]) {
                ints[nums[i]] = true;
                continue;
            }
            return nums[i];
        }
        return 0;
    }

    public static void main(String[] args) {
        Solution_961 model = new Solution_961();
        System.out.println(model.repeatedNTimes(new int[]{1,2,3,3}));
        System.out.println(model.repeatedNTimes(new int[]{2,1,2,5,3,2}));
        System.out.println(model.repeatedNTimes(new int[]{5,1,5,2,5,3,5,4}));
    }
}
